home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Developer Toolbox 6.1
/
SGI Developer Toolbox 6.1 - Disc 4.iso
/
src
/
demos
/
GL
/
ideas
/
draw_logo_line.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-08-01
|
8KB
|
357 lines
/*
* Copyright 1992, 1993, 1994, Silicon Graphics, Inc.
* All Rights Reserved.
*
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
* the contents of this file may not be disclosed to third parties, copied or
* duplicated in any form, in whole or in part, without the prior written
* permission of Silicon Graphics, Inc.
*
* RESTRICTED RIGHTS LEGEND:
* Use, duplication or disclosure by the Government is subject to restrictions
* as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
* and Computer Software clause at DFARS 252.227-7013, and/or in similar or
* successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
* rights reserved under the Copyright Laws of the United States.
*/
#include <gl.h>
#include "objects.h"
float scp[14][3] = {
{1.000000, 0.000000, 0.000000}, {1.000000, 0.000000, 5.000000},
{0.500000, 0.866025, 0.000000}, {0.500000, 0.866025, 5.000000},
{-0.500000, 0.866025, 0.000000}, {-0.500000, 0.866025, 5.000000},
{-1.000000, 0.000000, 0.000000}, {-1.000000, 0.000000, 5.000000},
{-0.500000, -0.866025, 0.000000}, {-0.500000, -0.866025, 5.000000},
{0.500000, -0.866025, 0.000000}, {0.500000, -0.866025, 5.000000},
{1.000000, 0.000000, 0.000000}, {1.000000, 0.000000, 5.000000},
};
float dcp[14][3] = {
{1.000000, 0.000000, 0.000000}, {1.000000, 0.000000, 7.000000},
{0.500000, 0.866025, 0.000000}, {0.500000, 0.866025, 7.000000},
{-0.500000, 0.866025, 0.000000}, {-0.500000, 0.866025, 7.000000},
{-1.000000, 0.000000, 0.000000}, {-1.000000, 0.000000, 7.000000},
{-0.500000, -0.866025, 0.000000}, {-0.500000, -0.866025, 7.000000},
{0.500000, -0.866025, 0.000000}, {0.500000, -0.866025, 7.000000},
{1.000000, 0.000000, 0.000000}, {1.000000, 0.000000, 7.000000},
};
float ep[7][7][3] = {
{
{1.000000, 0.000000, 0.000000},
{0.500000, 0.866025, 0.000000},
{-0.500000, 0.866025, 0.000000},
{-1.000000, 0.000000, 0.000000},
{-0.500000, -0.866025, 0.000000},
{0.500000, -0.866025, 0.000000},
{1.000000, 0.000000, 0.000000},
},
{
{1.000000, 0.034074, 0.258819},
{0.500000, 0.870590, 0.034675},
{-0.500000, 0.870590, 0.034675},
{-1.000000, 0.034074, 0.258819},
{-0.500000, -0.802442, 0.482963},
{0.500000, -0.802442, 0.482963},
{1.000000, 0.034074, 0.258819},
},
{
{1.000000, 0.133975, 0.500000},
{0.500000, 0.883975, 0.066987},
{-0.500000, 0.883975, 0.066987},
{-1.000000, 0.133975, 0.500000},
{-0.500000, -0.616025, 0.933013},
{0.500000, -0.616025, 0.933013},
{1.000000, 0.133975, 0.500000},
},
{
{1.000000, 0.292893, 0.707107},
{0.500000, 0.905266, 0.094734},
{-0.500000, 0.905266, 0.094734},
{-1.000000, 0.292893, 0.707107},
{-0.500000, -0.319479, 1.319479},
{0.500000, -0.319479, 1.319479},
{1.000000, 0.292893, 0.707107},
},
{
{1.000000, 0.500000, 0.866025},
{0.500000, 0.933013, 0.116025},
{-0.500000, 0.933013, 0.116025},
{-1.000000, 0.500000, 0.866025},
{-0.500000, 0.066987, 1.616025},
{0.500000, 0.066987, 1.616025},
{1.000000, 0.500000, 0.866025},
},
{
{1.000000, 0.741181, 0.965926},
{0.500000, 0.965325, 0.129410},
{-0.500000, 0.965325, 0.129410},
{-1.000000, 0.741181, 0.965926},
{-0.500000, 0.517037, 1.802442},
{0.500000, 0.517037, 1.802442},
{1.000000, 0.741181, 0.965926},
},
{
{1.000000, 1.000000, 1.000000},
{0.500000, 1.000000, 0.133975},
{-0.500000, 1.000000, 0.133975},
{-1.000000, 1.000000, 1.000000},
{-0.500000, 1.000000, 1.866025},
{0.500000, 1.000000, 1.866025},
{1.000000, 1.000000, 1.000000},
},
};
draw_single_cylinder() {
bgnline();
v3f(scp[0]);
v3f(scp[1]);
v3f(scp[2]);
v3f(scp[3]);
v3f(scp[4]);
v3f(scp[5]);
v3f(scp[6]);
v3f(scp[7]);
v3f(scp[8]);
v3f(scp[9]);
v3f(scp[10]);
v3f(scp[11]);
v3f(scp[12]);
v3f(scp[13]);
endline();
}
draw_double_cylinder() {
bgnline();
v3f(dcp[0]);
v3f(dcp[1]);
v3f(dcp[2]);
v3f(dcp[3]);
v3f(dcp[4]);
v3f(dcp[5]);
v3f(dcp[6]);
v3f(dcp[7]);
v3f(dcp[8]);
v3f(dcp[9]);
v3f(dcp[10]);
v3f(dcp[11]);
v3f(dcp[12]);
v3f(dcp[13]);
endline();
}
draw_elbow() {
bgnline();
v3f(ep[0][0]);
v3f(ep[1][0]);
v3f(ep[0][1]);
v3f(ep[1][1]);
v3f(ep[0][2]);
v3f(ep[1][2]);
v3f(ep[0][3]);
v3f(ep[1][3]);
v3f(ep[0][4]);
v3f(ep[1][4]);
v3f(ep[0][5]);
v3f(ep[1][5]);
v3f(ep[0][6]);
v3f(ep[1][6]);
endline();
bgnline();
v3f(ep[1][0]);
v3f(ep[2][0]);
v3f(ep[1][1]);
v3f(ep[2][1]);
v3f(ep[1][2]);
v3f(ep[2][2]);
v3f(ep[1][3]);
v3f(ep[2][3]);
v3f(ep[1][4]);
v3f(ep[2][4]);
v3f(ep[1][5]);
v3f(ep[2][5]);
v3f(ep[1][6]);
v3f(ep[2][6]);
endline();
bgnline();
v3f(ep[2][0]);
v3f(ep[3][0]);
v3f(ep[2][1]);
v3f(ep[3][1]);
v3f(ep[2][2]);
v3f(ep[3][2]);
v3f(ep[2][3]);
v3f(ep[3][3]);
v3f(ep[2][4]);
v3f(ep[3][4]);
v3f(ep[2][5]);
v3f(ep[3][5]);
v3f(ep[2][6]);
v3f(ep[3][6]);
endline();
bgnline();
v3f(ep[3][0]);
v3f(ep[4][0]);
v3f(ep[3][1]);
v3f(ep[4][1]);
v3f(ep[3][2]);
v3f(ep[4][2]);
v3f(ep[3][3]);
v3f(ep[4][3]);
v3f(ep[3][4]);
v3f(ep[4][4]);
v3f(ep[3][5]);
v3f(ep[4][5]);
v3f(ep[3][6]);
v3f(ep[4][6]);
endline();
bgnline();
v3f(ep[4][0]);
v3f(ep[5][0]);
v3f(ep[4][1]);
v3f(ep[5][1]);
v3f(ep[4][2]);
v3f(ep[5][2]);
v3f(ep[4][3]);
v3f(ep[5][3]);
v3f(ep[4][4]);
v3f(ep[5][4]);
v3f(ep[4][5]);
v3f(ep[5][5]);
v3f(ep[4][6]);
v3f(ep[5][6]);
endline();
bgnline();
v3f(ep[5][0]);
v3f(ep[6][0]);
v3f(ep[5][1]);
v3f(ep[6][1]);
v3f(ep[5][2]);
v3f(ep[6][2]);
v3f(ep[5][3]);
v3f(ep[6][3]);
v3f(ep[5][4]);
v3f(ep[6][4]);
v3f(ep[5][5]);
v3f(ep[6][5]);
v3f(ep[5][6]);
v3f(ep[6][6]);
endline();
}
bend_forward() {
translate(0.0, 1.000000, 0.0);
rotate(900, 'x');
translate(0.0, -1.000000, 0.0);
}
bend_left() {
rotate(-900, 'z');
translate(0.0, 1.000000, 0.0);
rotate(900, 'x');
translate(0.0, -1.000000, 0.0);
}
bend_right() {
rotate(900, 'z');
translate(0.0, 1.000000, 0.0);
rotate(900, 'x');
translate(0.0, -1.000000, 0.0);
}
draw_logo_line() {
lmbind(MATERIAL, MAT_LOGO);
translate(5.500000, -3.500000, 4.500000);
translate(0.0, 0.0, -7.000000);
draw_double_cylinder();
bend_forward();
draw_elbow();
translate(0.0, 0.0, -7.000000);
draw_double_cylinder();
bend_forward();
draw_elbow();
translate(0.0, 0.0, -5.000000);
draw_single_cylinder();
bend_right();
draw_elbow();
translate(0.0, 0.0, -7.000000);
draw_double_cylinder();
bend_forward();
draw_elbow();
translate(0.0, 0.0, -7.000000);
draw_double_cylinder();
bend_forward();
draw_elbow();
translate(0.0, 0.0, -5.000000);
draw_single_cylinder();
bend_left();
draw_elbow();
translate(0.0, 0.0, -7.000000);
draw_double_cylinder();
bend_forward();
draw_elbow();
translate(0.0, 0.0, -7.000000);
draw_double_cylinder();
bend_forward();
draw_elbow();
translate(0.0, 0.0, -5.000000);
draw_single_cylinder();
bend_right();
draw_elbow();
translate(0.0, 0.0, -7.000000);
draw_double_cylinder();
bend_forward();
draw_elbow();
translate(0.0, 0.0, -7.000000);
draw_double_cylinder();
bend_forward();
draw_elbow();
translate(0.0, 0.0, -5.000000);
draw_single_cylinder();
bend_left();
draw_elbow();
translate(0.0, 0.0, -7.000000);
draw_double_cylinder();
bend_forward();
draw_elbow();
translate(0.0, 0.0, -7.000000);
draw_double_cylinder();
bend_forward();
draw_elbow();
translate(0.0, 0.0, -5.000000);
draw_single_cylinder();
bend_right();
draw_elbow();
translate(0.0, 0.0, -7.000000);
draw_double_cylinder();
bend_forward();
draw_elbow();
translate(0.0, 0.0, -7.000000);
draw_double_cylinder();
bend_forward();
draw_elbow();
translate(0.0, 0.0, -5.000000);
draw_single_cylinder();
bend_left();
draw_elbow();
}